<?php

class ServicesController extends Henry_Controller_Action
{
    public function init()
    {
        parent::init();
        $this->_helper->layout->setLayout('other');
    }
    public function indexAction(){
        $id = $this->_request->getParam("id");
        $sid = $this->_request->getParam("sid",-1);
        $serviceOb = new Henry_Services_Services();
        if ($sid == -1){            
            $tmp = $serviceOb->fetchAll("categories_id = $id","order ASC")->toArray();
            $this->view->sitem = $tmp[0];
            unset($tmp[0]);
            $this->view->list = $tmp;
        }else{
            $tmp = $serviceOb->find($sid)->toArray();
            $this->view->sitem = $tmp[0];
            $tmp = $serviceOb->fetchAll("categories_id = $id and clip_id != $sid","order ASC");
            $this->view->list = $tmp;
        }
    }


}

